<?php
include_once 'includes/metodos.php';
include("cabecalho.php");

connectSQL();

$search = $_REQUEST['search'];
$local = $_REQUEST['local'];

$query = mysql_query("SELECT col.titulo, n.titulo, mul.titulo, glo.tterm, n.created_at as criado FROM econ_colunista col, econ_noticias n, econ_multimidia mul, econ_glossario glo WHERE col.titulo like '%$search%' OR col.conteudo like '%$search%' OR n.titulo like '%$search%' OR n.texto like '%$search%' OR mul.titulo like '%$search%' OR glo.tterm like '%$search%' OR glo.conteudo like '%$search%' ORDER BY criado ASC LIMIT 20");
while($row = mysql_fetch_array($query)){
	echo $row['titulo'].'<br><br>';
}

?>
<div id="conteudonoticia">
<?php include ("col_dir.php");?>
 <div id="meio_noticia">
   <div style="border:1px solid#00ff00;">
   		<form name="formTeste" action="busca.php" method="post">
   			<label>Pesquisa</label>
   			<input type="text" name="texto"/><br/>
   			<label>Per&iacute;odo</label>
   			<input type=text name="data_ant"/>
   			<label>a</label>
   			<input type="text" name="data_post"><br/>
   			<label>Categoria</label>
   			<select name="categoria">
   				<option value="0">Todos</option>
   				<?php
   					$query = mysql_query("SELECT * FROM econ_categorias ORDER BY nome ASC");
   					while($row = mysql_fetch_array($query)){
   						echo '<option value="'.$row['id'].'">'.$row['nome'].'</option>';
   					}
   				?>
   			</select><br/>
   			<input type="hidden" name="cmd" value="noticia"/>
   			<input type="submit" value="Buscar">
   		</form>   
   </div>
 </div>
</div>